package com.itkaien.ssmconformitymaven.config;


import com.itkaien.ssmconformitymaven.controller.DefaultController;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.RouterFunctions;
import org.springframework.web.servlet.function.ServerResponse;

@Configuration
//@MapperScan("com.itkaien.ssmconformitymaven.mapper")
public class routerConfig {


    @Bean
    public RouterFunction<ServerResponse> routerFunction(DefaultController defaultController){
        RouterFunction<ServerResponse> routerFunction = RouterFunctions.route()
                .GET("/hello", request -> ServerResponse.ok().body("hello world"))
                .GET("/default", defaultController::getDefault)
                .build();
        return routerFunction;
    }

}
